.class Lcom/bigtincan/android/adfree/DoUpgrade$13;
.super Ljava/lang/Object;
.source "DoUpgrade.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/bigtincan/android/adfree/DoUpgrade;->Revert()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/bigtincan/android/adfree/DoUpgrade;


# direct methods
.method constructor <init>(Lcom/bigtincan/android/adfree/DoUpgrade;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    .line 391
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 10

    .prologue
    const-wide/16 v8, 0x0

    const/4 v6, 0x1

    const/4 v7, 0x0

    .line 397
    const-string v4, "Revert() Thread started."

    invoke-static {v4}, Lcom/bigtincan/android/adfree/Common;->LogMessage(Ljava/lang/String;)V

    .line 399
    const-string v0, ""

    .line 400
    .local v0, cmd:Ljava/lang/String;
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$8(Lcom/bigtincan/android/adfree/DoUpgrade;)Lcom/bigtincan/android/adfree/Common;

    move-result-object v4

    invoke-virtual {v4}, Lcom/bigtincan/android/adfree/Common;->GetSystem()[Ljava/lang/String;

    move-result-object v3

    .line 401
    .local v3, ret:[Ljava/lang/String;
    aget-object v1, v3, v6

    .line 402
    .local v1, partition:Ljava/lang/String;
    const/4 v2, 0x0

    .line 404
    .local v2, remounted:Z
    aget-object v4, v3, v7

    if-eqz v4, :cond_1

    .line 406
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    aget-object v5, v3, v7

    invoke-static {v4, v5}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$11(Lcom/bigtincan/android/adfree/DoUpgrade;Ljava/lang/String;)V

    .line 407
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$12(Lcom/bigtincan/android/adfree/DoUpgrade;)Ljava/lang/String;

    move-result-object v4

    if-nez v4, :cond_0

    .line 408
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    iget-object v5, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    const v6, 0x7f040020

    invoke-virtual {v5, v6}, Lcom/bigtincan/android/adfree/DoUpgrade;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$11(Lcom/bigtincan/android/adfree/DoUpgrade;Ljava/lang/String;)V

    .line 457
    :cond_0
    :goto_0
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$14(Lcom/bigtincan/android/adfree/DoUpgrade;)Landroid/os/Handler;

    move-result-object v4

    invoke-virtual {v4, v7}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    .line 458
    return-void

    .line 412
    :cond_1
    const-string v4, "DoUpgrade.Revert():367"

    invoke-static {v4}, Lcom/bigtincan/android/adfree/Common;->LogMessage(Ljava/lang/String;)V

    .line 413
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$8(Lcom/bigtincan/android/adfree/DoUpgrade;)Lcom/bigtincan/android/adfree/Common;

    move-result-object v4

    invoke-virtual {v4}, Lcom/bigtincan/android/adfree/Common;->isLink()Z

    move-result v4

    if-nez v4, :cond_3

    .line 415
    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "Need to write to /system/etc/hosts so attempting to remount "

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, " rw"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Lcom/bigtincan/android/adfree/Common;->LogMessage(Ljava/lang/String;)V

    .line 416
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    iget-object v5, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v5}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$8(Lcom/bigtincan/android/adfree/DoUpgrade;)Lcom/bigtincan/android/adfree/Common;

    move-result-object v5

    invoke-virtual {v5, v1, v6}, Lcom/bigtincan/android/adfree/Common;->RemountPartition(Ljava/lang/String;Z)Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$11(Lcom/bigtincan/android/adfree/DoUpgrade;Ljava/lang/String;)V

    if-eqz v5, :cond_2

    .line 418
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$12(Lcom/bigtincan/android/adfree/DoUpgrade;)Ljava/lang/String;

    move-result-object v4

    const-string v5, ""

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 419
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    iget-object v5, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    const v6, 0x7f04001e

    invoke-virtual {v5, v6}, Lcom/bigtincan/android/adfree/DoUpgrade;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$11(Lcom/bigtincan/android/adfree/DoUpgrade;Ljava/lang/String;)V

    goto :goto_0

    .line 422
    :cond_2
    const/4 v2, 0x1

    .line 425
    :cond_3
    const-string v0, "echo \"127.0.0.1 localhost\" > /system/etc/hosts"

    .line 426
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$8(Lcom/bigtincan/android/adfree/DoUpgrade;)Lcom/bigtincan/android/adfree/Common;

    move-result-object v4

    invoke-virtual {v4}, Lcom/bigtincan/android/adfree/Common;->isLink()Z

    move-result v4

    if-eqz v4, :cond_4

    .line 427
    const-string v0, "echo \"127.0.0.1 localhost\" > /data/data/hosts"

    .line 429
    :cond_4
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    iget-object v5, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v5}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$8(Lcom/bigtincan/android/adfree/DoUpgrade;)Lcom/bigtincan/android/adfree/Common;

    move-result-object v5

    invoke-virtual {v5, v0}, Lcom/bigtincan/android/adfree/Common;->RunAsRoot(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$11(Lcom/bigtincan/android/adfree/DoUpgrade;Ljava/lang/String;)V

    if-eqz v5, :cond_5

    .line 431
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$12(Lcom/bigtincan/android/adfree/DoUpgrade;)Ljava/lang/String;

    move-result-object v4

    const-string v5, ""

    invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 432
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    iget-object v5, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    const v6, 0x7f04001f

    invoke-virtual {v5, v6}, Lcom/bigtincan/android/adfree/DoUpgrade;->getString(I)Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$11(Lcom/bigtincan/android/adfree/DoUpgrade;Ljava/lang/String;)V

    goto/16 :goto_0

    .line 436
    :cond_5
    if-eqz v2, :cond_6

    .line 438
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$8(Lcom/bigtincan/android/adfree/DoUpgrade;)Lcom/bigtincan/android/adfree/Common;

    move-result-object v4

    invoke-virtual {v4, v1, v7}, Lcom/bigtincan/android/adfree/Common;->RemountPartition(Ljava/lang/String;Z)Ljava/lang/String;

    .line 450
    const/4 v2, 0x0

    .line 453
    :cond_6
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4, v8, v9}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$13(Lcom/bigtincan/android/adfree/DoUpgrade;J)V

    .line 454
    iget-object v4, p0, Lcom/bigtincan/android/adfree/DoUpgrade$13;->this$0:Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-static {v4}, Lcom/bigtincan/android/adfree/DoUpgrade;->access$8(Lcom/bigtincan/android/adfree/DoUpgrade;)Lcom/bigtincan/android/adfree/Common;

    move-result-object v4

    invoke-virtual {v4, v8, v9}, Lcom/bigtincan/android/adfree/Common;->SetLocalVer(J)V

    goto/16 :goto_0
.end method
